#include <iostream>  
  
double pow(double x, int n) {  
    if (n == 0)  
        return 1;  
    if (n == 1)  
        return x;  
    if (n % 2 == 0)  
        return pow(x * x, n / 2);  
    else  
        return pow(x * x, n / 2) * x;  
}  
  
int main() {  
    double base;  
    int exponent;  
  
    std::cout << "请输入底数: ";  
    std::cin >> base;  

    std::cout << "请输入指数: ";  
    std::cin >> exponent;  
  
    double result = pow(base, exponent);  
  
    std::cout << "幂的运算结果是: " << result << std::endl;  
  
    return 0;  
}  